{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Trending YouTube Video 频繁模式与关联规则挖掘\n",
    "仓库地址为：https://gitee.com/chen-shichen/DataMiningClass/tree/master/work2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import json\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt\n",
    "import youtube_process"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "def get_category_list(path,filename):\n",
    "    with open(path + '/' + filename ,'r') as f:\n",
    "        d = json.load(f)\n",
    "    res = {}\n",
    "    for i in d['items']:\n",
    "        res[int(i['id'])] = i['snippet']['title']\n",
    "    return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data(path,filename):\n",
    "    return pd.read_csv(path + '/' + filename,keep_default_na=False,low_memory=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "确定数据集根目录："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "root = 'data/youtube-new/'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 选取美国数据集进行频繁模式与关联规则挖掘"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>video_id</th>\n",
       "      <th>trending_date</th>\n",
       "      <th>title</th>\n",
       "      <th>channel_title</th>\n",
       "      <th>category_id</th>\n",
       "      <th>publish_time</th>\n",
       "      <th>tags</th>\n",
       "      <th>views</th>\n",
       "      <th>likes</th>\n",
       "      <th>dislikes</th>\n",
       "      <th>comment_count</th>\n",
       "      <th>thumbnail_link</th>\n",
       "      <th>comments_disabled</th>\n",
       "      <th>ratings_disabled</th>\n",
       "      <th>video_error_or_removed</th>\n",
       "      <th>description</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2kyS6SvSYSE</td>\n",
       "      <td>17.14.11</td>\n",
       "      <td>WE WANT TO TALK ABOUT OUR MARRIAGE</td>\n",
       "      <td>CaseyNeistat</td>\n",
       "      <td>22</td>\n",
       "      <td>2017-11-13T17:13:01.000Z</td>\n",
       "      <td>SHANtell martin</td>\n",
       "      <td>748374</td>\n",
       "      <td>57527</td>\n",
       "      <td>2966</td>\n",
       "      <td>15954</td>\n",
       "      <td>https://i.ytimg.com/vi/2kyS6SvSYSE/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>SHANTELL'S CHANNEL - https://www.youtube.com/s...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1ZAPwfrtAFY</td>\n",
       "      <td>17.14.11</td>\n",
       "      <td>The Trump Presidency: Last Week Tonight with J...</td>\n",
       "      <td>LastWeekTonight</td>\n",
       "      <td>24</td>\n",
       "      <td>2017-11-13T07:30:00.000Z</td>\n",
       "      <td>last week tonight trump presidency|\"last week ...</td>\n",
       "      <td>2418783</td>\n",
       "      <td>97185</td>\n",
       "      <td>6146</td>\n",
       "      <td>12703</td>\n",
       "      <td>https://i.ytimg.com/vi/1ZAPwfrtAFY/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>One year after the presidential election, John...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5qpjK5DgCt4</td>\n",
       "      <td>17.14.11</td>\n",
       "      <td>Racist Superman | Rudy Mancuso, King Bach &amp; Le...</td>\n",
       "      <td>Rudy Mancuso</td>\n",
       "      <td>23</td>\n",
       "      <td>2017-11-12T19:05:24.000Z</td>\n",
       "      <td>racist superman|\"rudy\"|\"mancuso\"|\"king\"|\"bach\"...</td>\n",
       "      <td>3191434</td>\n",
       "      <td>146033</td>\n",
       "      <td>5339</td>\n",
       "      <td>8181</td>\n",
       "      <td>https://i.ytimg.com/vi/5qpjK5DgCt4/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>WATCH MY PREVIOUS VIDEO ▶ \\n\\nSUBSCRIBE ► http...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>puqaWrEC7tY</td>\n",
       "      <td>17.14.11</td>\n",
       "      <td>Nickelback Lyrics: Real or Fake?</td>\n",
       "      <td>Good Mythical Morning</td>\n",
       "      <td>24</td>\n",
       "      <td>2017-11-13T11:00:04.000Z</td>\n",
       "      <td>rhett and link|\"gmm\"|\"good mythical morning\"|\"...</td>\n",
       "      <td>343168</td>\n",
       "      <td>10172</td>\n",
       "      <td>666</td>\n",
       "      <td>2146</td>\n",
       "      <td>https://i.ytimg.com/vi/puqaWrEC7tY/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>Today we find out if Link is a Nickelback amat...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>d380meD0W0M</td>\n",
       "      <td>17.14.11</td>\n",
       "      <td>I Dare You: GOING BALD!?</td>\n",
       "      <td>nigahiga</td>\n",
       "      <td>24</td>\n",
       "      <td>2017-11-12T18:01:41.000Z</td>\n",
       "      <td>ryan|\"higa\"|\"higatv\"|\"nigahiga\"|\"i dare you\"|\"...</td>\n",
       "      <td>2095731</td>\n",
       "      <td>132235</td>\n",
       "      <td>1989</td>\n",
       "      <td>17518</td>\n",
       "      <td>https://i.ytimg.com/vi/d380meD0W0M/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>I know it's been a while since we did this sho...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40944</th>\n",
       "      <td>BZt0qjTWNhw</td>\n",
       "      <td>18.14.06</td>\n",
       "      <td>The Cat Who Caught the Laser</td>\n",
       "      <td>AaronsAnimals</td>\n",
       "      <td>15</td>\n",
       "      <td>2018-05-18T13:00:04.000Z</td>\n",
       "      <td>aarons animals|\"aarons\"|\"animals\"|\"cat\"|\"cats\"...</td>\n",
       "      <td>1685609</td>\n",
       "      <td>38160</td>\n",
       "      <td>1385</td>\n",
       "      <td>2657</td>\n",
       "      <td>https://i.ytimg.com/vi/BZt0qjTWNhw/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>The Cat Who Caught the Laser - Aaron's Animals</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40945</th>\n",
       "      <td>1h7KV2sjUWY</td>\n",
       "      <td>18.14.06</td>\n",
       "      <td>True Facts : Ant Mutualism</td>\n",
       "      <td>zefrank1</td>\n",
       "      <td>22</td>\n",
       "      <td>2018-05-18T01:00:06.000Z</td>\n",
       "      <td>[none]</td>\n",
       "      <td>1064798</td>\n",
       "      <td>60008</td>\n",
       "      <td>382</td>\n",
       "      <td>3936</td>\n",
       "      <td>https://i.ytimg.com/vi/1h7KV2sjUWY/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40946</th>\n",
       "      <td>D6Oy4LfoqsU</td>\n",
       "      <td>18.14.06</td>\n",
       "      <td>I GAVE SAFIYA NYGAARD A PERFECT HAIR MAKEOVER ...</td>\n",
       "      <td>Brad Mondo</td>\n",
       "      <td>24</td>\n",
       "      <td>2018-05-18T17:34:22.000Z</td>\n",
       "      <td>I gave safiya nygaard a perfect hair makeover ...</td>\n",
       "      <td>1066451</td>\n",
       "      <td>48068</td>\n",
       "      <td>1032</td>\n",
       "      <td>3992</td>\n",
       "      <td>https://i.ytimg.com/vi/D6Oy4LfoqsU/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>I had so much fun transforming Safiyas hair in...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40947</th>\n",
       "      <td>oV0zkMe1K8s</td>\n",
       "      <td>18.14.06</td>\n",
       "      <td>How Black Panther Should Have Ended</td>\n",
       "      <td>How It Should Have Ended</td>\n",
       "      <td>1</td>\n",
       "      <td>2018-05-17T17:00:04.000Z</td>\n",
       "      <td>Black Panther|\"HISHE\"|\"Marvel\"|\"Infinity War\"|...</td>\n",
       "      <td>5660813</td>\n",
       "      <td>192957</td>\n",
       "      <td>2846</td>\n",
       "      <td>13088</td>\n",
       "      <td>https://i.ytimg.com/vi/oV0zkMe1K8s/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>How Black Panther Should Have EndedWatch More ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40948</th>\n",
       "      <td>ooyjaVdt-jA</td>\n",
       "      <td>18.14.06</td>\n",
       "      <td>Official Call of Duty®: Black Ops 4 — Multipla...</td>\n",
       "      <td>Call of Duty</td>\n",
       "      <td>20</td>\n",
       "      <td>2018-05-17T17:09:38.000Z</td>\n",
       "      <td>call of duty|\"cod\"|\"activision\"|\"Black Ops 4\"</td>\n",
       "      <td>10306119</td>\n",
       "      <td>357079</td>\n",
       "      <td>212976</td>\n",
       "      <td>144795</td>\n",
       "      <td>https://i.ytimg.com/vi/ooyjaVdt-jA/default.jpg</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>Call of Duty: Black Ops 4 Multiplayer raises t...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>40949 rows × 16 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          video_id trending_date  \\\n",
       "0      2kyS6SvSYSE      17.14.11   \n",
       "1      1ZAPwfrtAFY      17.14.11   \n",
       "2      5qpjK5DgCt4      17.14.11   \n",
       "3      puqaWrEC7tY      17.14.11   \n",
       "4      d380meD0W0M      17.14.11   \n",
       "...            ...           ...   \n",
       "40944  BZt0qjTWNhw      18.14.06   \n",
       "40945  1h7KV2sjUWY      18.14.06   \n",
       "40946  D6Oy4LfoqsU      18.14.06   \n",
       "40947  oV0zkMe1K8s      18.14.06   \n",
       "40948  ooyjaVdt-jA      18.14.06   \n",
       "\n",
       "                                                   title  \\\n",
       "0                     WE WANT TO TALK ABOUT OUR MARRIAGE   \n",
       "1      The Trump Presidency: Last Week Tonight with J...   \n",
       "2      Racist Superman | Rudy Mancuso, King Bach & Le...   \n",
       "3                       Nickelback Lyrics: Real or Fake?   \n",
       "4                               I Dare You: GOING BALD!?   \n",
       "...                                                  ...   \n",
       "40944                       The Cat Who Caught the Laser   \n",
       "40945                         True Facts : Ant Mutualism   \n",
       "40946  I GAVE SAFIYA NYGAARD A PERFECT HAIR MAKEOVER ...   \n",
       "40947                How Black Panther Should Have Ended   \n",
       "40948  Official Call of Duty®: Black Ops 4 — Multipla...   \n",
       "\n",
       "                  channel_title  category_id              publish_time  \\\n",
       "0                  CaseyNeistat           22  2017-11-13T17:13:01.000Z   \n",
       "1               LastWeekTonight           24  2017-11-13T07:30:00.000Z   \n",
       "2                  Rudy Mancuso           23  2017-11-12T19:05:24.000Z   \n",
       "3         Good Mythical Morning           24  2017-11-13T11:00:04.000Z   \n",
       "4                      nigahiga           24  2017-11-12T18:01:41.000Z   \n",
       "...                         ...          ...                       ...   \n",
       "40944             AaronsAnimals           15  2018-05-18T13:00:04.000Z   \n",
       "40945                  zefrank1           22  2018-05-18T01:00:06.000Z   \n",
       "40946                Brad Mondo           24  2018-05-18T17:34:22.000Z   \n",
       "40947  How It Should Have Ended            1  2018-05-17T17:00:04.000Z   \n",
       "40948              Call of Duty           20  2018-05-17T17:09:38.000Z   \n",
       "\n",
       "                                                    tags     views   likes  \\\n",
       "0                                        SHANtell martin    748374   57527   \n",
       "1      last week tonight trump presidency|\"last week ...   2418783   97185   \n",
       "2      racist superman|\"rudy\"|\"mancuso\"|\"king\"|\"bach\"...   3191434  146033   \n",
       "3      rhett and link|\"gmm\"|\"good mythical morning\"|\"...    343168   10172   \n",
       "4      ryan|\"higa\"|\"higatv\"|\"nigahiga\"|\"i dare you\"|\"...   2095731  132235   \n",
       "...                                                  ...       ...     ...   \n",
       "40944  aarons animals|\"aarons\"|\"animals\"|\"cat\"|\"cats\"...   1685609   38160   \n",
       "40945                                             [none]   1064798   60008   \n",
       "40946  I gave safiya nygaard a perfect hair makeover ...   1066451   48068   \n",
       "40947  Black Panther|\"HISHE\"|\"Marvel\"|\"Infinity War\"|...   5660813  192957   \n",
       "40948      call of duty|\"cod\"|\"activision\"|\"Black Ops 4\"  10306119  357079   \n",
       "\n",
       "       dislikes  comment_count  \\\n",
       "0          2966          15954   \n",
       "1          6146          12703   \n",
       "2          5339           8181   \n",
       "3           666           2146   \n",
       "4          1989          17518   \n",
       "...         ...            ...   \n",
       "40944      1385           2657   \n",
       "40945       382           3936   \n",
       "40946      1032           3992   \n",
       "40947      2846          13088   \n",
       "40948    212976         144795   \n",
       "\n",
       "                                       thumbnail_link  comments_disabled  \\\n",
       "0      https://i.ytimg.com/vi/2kyS6SvSYSE/default.jpg              False   \n",
       "1      https://i.ytimg.com/vi/1ZAPwfrtAFY/default.jpg              False   \n",
       "2      https://i.ytimg.com/vi/5qpjK5DgCt4/default.jpg              False   \n",
       "3      https://i.ytimg.com/vi/puqaWrEC7tY/default.jpg              False   \n",
       "4      https://i.ytimg.com/vi/d380meD0W0M/default.jpg              False   \n",
       "...                                               ...                ...   \n",
       "40944  https://i.ytimg.com/vi/BZt0qjTWNhw/default.jpg              False   \n",
       "40945  https://i.ytimg.com/vi/1h7KV2sjUWY/default.jpg              False   \n",
       "40946  https://i.ytimg.com/vi/D6Oy4LfoqsU/default.jpg              False   \n",
       "40947  https://i.ytimg.com/vi/oV0zkMe1K8s/default.jpg              False   \n",
       "40948  https://i.ytimg.com/vi/ooyjaVdt-jA/default.jpg              False   \n",
       "\n",
       "       ratings_disabled  video_error_or_removed  \\\n",
       "0                 False                   False   \n",
       "1                 False                   False   \n",
       "2                 False                   False   \n",
       "3                 False                   False   \n",
       "4                 False                   False   \n",
       "...                 ...                     ...   \n",
       "40944             False                   False   \n",
       "40945             False                   False   \n",
       "40946             False                   False   \n",
       "40947             False                   False   \n",
       "40948             False                   False   \n",
       "\n",
       "                                             description  \n",
       "0      SHANTELL'S CHANNEL - https://www.youtube.com/s...  \n",
       "1      One year after the presidential election, John...  \n",
       "2      WATCH MY PREVIOUS VIDEO ▶ \\n\\nSUBSCRIBE ► http...  \n",
       "3      Today we find out if Link is a Nickelback amat...  \n",
       "4      I know it's been a while since we did this sho...  \n",
       "...                                                  ...  \n",
       "40944     The Cat Who Caught the Laser - Aaron's Animals  \n",
       "40945                                                     \n",
       "40946  I had so much fun transforming Safiyas hair in...  \n",
       "40947  How Black Panther Should Have EndedWatch More ...  \n",
       "40948  Call of Duty: Black Ops 4 Multiplayer raises t...  \n",
       "\n",
       "[40949 rows x 16 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "US = youtube_process.country_data(root, 'USvideos.csv')\n",
    "US_data = US.data\n",
    "US_data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据包含：  \n",
    "1. video_id  视频id\n",
    "2. trending_date  流行日期\n",
    "3. title  标题\n",
    "4. channel_title  频道标题\n",
    "5. category_id  类别id\n",
    "6. publish_time  发布时间\n",
    "7. tags  标签\n",
    "8. views  观看量\n",
    "9. likes  点赞量\n",
    "10. dislikes  踩量\n",
    "11. comment_count  评论数量\n",
    "12. thumbnail_link  视频链接\n",
    "13. comments_disabled  是否禁止评论\n",
    "14. ratings_disabled  是否禁止评分\n",
    "15. video_error_or_removed  视频是否失效或被移除\n",
    "16. description  介绍"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 将数据集转换成适合进行关联规则挖掘的形式"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "选择挖掘视频类别(category)与观看量(views)的关联关系，从而挖掘出大众篇好的视频类别"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>category_id</th>\n",
       "      <th>views</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22</td>\n",
       "      <td>748374</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>24</td>\n",
       "      <td>2418783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>23</td>\n",
       "      <td>3191434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>24</td>\n",
       "      <td>343168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>24</td>\n",
       "      <td>2095731</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40944</th>\n",
       "      <td>15</td>\n",
       "      <td>1685609</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40945</th>\n",
       "      <td>22</td>\n",
       "      <td>1064798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40946</th>\n",
       "      <td>24</td>\n",
       "      <td>1066451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40947</th>\n",
       "      <td>1</td>\n",
       "      <td>5660813</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40948</th>\n",
       "      <td>20</td>\n",
       "      <td>10306119</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>40949 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       category_id     views\n",
       "0               22    748374\n",
       "1               24   2418783\n",
       "2               23   3191434\n",
       "3               24    343168\n",
       "4               24   2095731\n",
       "...            ...       ...\n",
       "40944           15   1685609\n",
       "40945           22   1064798\n",
       "40946           24   1066451\n",
       "40947            1   5660813\n",
       "40948           20  10306119\n",
       "\n",
       "[40949 rows x 2 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = US_data[['category_id','views']]\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将category_id映射到具体的category类别名："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: 'Film & Animation',\n",
       " 2: 'Autos & Vehicles',\n",
       " 10: 'Music',\n",
       " 15: 'Pets & Animals',\n",
       " 17: 'Sports',\n",
       " 18: 'Short Movies',\n",
       " 19: 'Travel & Events',\n",
       " 20: 'Gaming',\n",
       " 21: 'Videoblogging',\n",
       " 22: 'People & Blogs',\n",
       " 23: 'Comedy',\n",
       " 24: 'Entertainment',\n",
       " 25: 'News & Politics',\n",
       " 26: 'Howto & Style',\n",
       " 27: 'Education',\n",
       " 28: 'Science & Technology',\n",
       " 29: 'Nonprofits & Activism',\n",
       " 30: 'Movies',\n",
       " 31: 'Anime/Animation',\n",
       " 32: 'Action/Adventure',\n",
       " 33: 'Classics',\n",
       " 34: 'Comedy',\n",
       " 35: 'Documentary',\n",
       " 36: 'Drama',\n",
       " 37: 'Family',\n",
       " 38: 'Foreign',\n",
       " 39: 'Horror',\n",
       " 40: 'Sci-Fi/Fantasy',\n",
       " 41: 'Thriller',\n",
       " 42: 'Shorts',\n",
       " 43: 'Shows',\n",
       " 44: 'Trailers'}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "US_category_map = get_category_list(root, 'US_category_id.json')\n",
    "US_category_map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = df['category_id'].map(US_category_map)\n",
    "df = pd.concat([df,df1],axis=1)\n",
    "df.columns=['category_id','views','category']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由于views数值型数据，需要将其转化为离散型数据,按照作业1中的五数分布及离群点划分视频观看等级。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "def grading_views(views):\n",
    "    US_views_map = lambda x: {\n",
    "        x >= 4194399 : 'S',\n",
    "        1823157 <= x < 4194399 : 'A',\n",
    "        681861 <= x < 1823157 : 'B',\n",
    "        242329 <= x < 681861 : 'C',\n",
    "        549 <= x < 242329 : 'D',\n",
    "    }\n",
    "    return US_views_map(views)[True]\n",
    "\n",
    "views_grade = []\n",
    "for views in df['views'].values:\n",
    "    views_grade.append(grading_views(views))\n",
    "df['views_grade'] = views_grade"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>category</th>\n",
       "      <th>views_grade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>People &amp; Blogs</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Entertainment</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Comedy</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Entertainment</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Entertainment</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40944</th>\n",
       "      <td>Pets &amp; Animals</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40945</th>\n",
       "      <td>People &amp; Blogs</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40946</th>\n",
       "      <td>Entertainment</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40947</th>\n",
       "      <td>Film &amp; Animation</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40948</th>\n",
       "      <td>Gaming</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>40949 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               category views_grade\n",
       "0        People & Blogs           B\n",
       "1         Entertainment           A\n",
       "2                Comedy           A\n",
       "3         Entertainment           C\n",
       "4         Entertainment           A\n",
       "...                 ...         ...\n",
       "40944    Pets & Animals           B\n",
       "40945    People & Blogs           B\n",
       "40946     Entertainment           B\n",
       "40947  Film & Animation           S\n",
       "40948            Gaming           S\n",
       "\n",
       "[40949 rows x 2 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = df.drop(['category_id','views'],axis=1)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "转换表格为模型可接受数据："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>Autos &amp; Vehicles</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>Comedy</th>\n",
       "      <th>D</th>\n",
       "      <th>Education</th>\n",
       "      <th>Entertainment</th>\n",
       "      <th>Film &amp; Animation</th>\n",
       "      <th>Gaming</th>\n",
       "      <th>...</th>\n",
       "      <th>Music</th>\n",
       "      <th>News &amp; Politics</th>\n",
       "      <th>Nonprofits &amp; Activism</th>\n",
       "      <th>People &amp; Blogs</th>\n",
       "      <th>Pets &amp; Animals</th>\n",
       "      <th>S</th>\n",
       "      <th>Science &amp; Technology</th>\n",
       "      <th>Shows</th>\n",
       "      <th>Sports</th>\n",
       "      <th>Travel &amp; Events</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40944</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40945</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40946</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40947</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40948</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>...</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>40949 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           A  Autos & Vehicles      B      C  Comedy      D  Education  \\\n",
       "0      False             False   True  False   False  False      False   \n",
       "1       True             False  False  False   False  False      False   \n",
       "2       True             False  False  False    True  False      False   \n",
       "3      False             False  False   True   False  False      False   \n",
       "4       True             False  False  False   False  False      False   \n",
       "...      ...               ...    ...    ...     ...    ...        ...   \n",
       "40944  False             False   True  False   False  False      False   \n",
       "40945  False             False   True  False   False  False      False   \n",
       "40946  False             False   True  False   False  False      False   \n",
       "40947  False             False  False  False   False  False      False   \n",
       "40948  False             False  False  False   False  False      False   \n",
       "\n",
       "       Entertainment  Film & Animation  Gaming  ...  Music  News & Politics  \\\n",
       "0              False             False   False  ...  False            False   \n",
       "1               True             False   False  ...  False            False   \n",
       "2              False             False   False  ...  False            False   \n",
       "3               True             False   False  ...  False            False   \n",
       "4               True             False   False  ...  False            False   \n",
       "...              ...               ...     ...  ...    ...              ...   \n",
       "40944          False             False   False  ...  False            False   \n",
       "40945          False             False   False  ...  False            False   \n",
       "40946           True             False   False  ...  False            False   \n",
       "40947          False              True   False  ...  False            False   \n",
       "40948          False             False    True  ...  False            False   \n",
       "\n",
       "       Nonprofits & Activism  People & Blogs  Pets & Animals      S  \\\n",
       "0                      False            True           False  False   \n",
       "1                      False           False           False  False   \n",
       "2                      False           False           False  False   \n",
       "3                      False           False           False  False   \n",
       "4                      False           False           False  False   \n",
       "...                      ...             ...             ...    ...   \n",
       "40944                  False           False            True  False   \n",
       "40945                  False            True           False  False   \n",
       "40946                  False           False           False  False   \n",
       "40947                  False           False           False   True   \n",
       "40948                  False           False           False   True   \n",
       "\n",
       "       Science & Technology  Shows  Sports  Travel & Events  \n",
       "0                     False  False   False            False  \n",
       "1                     False  False   False            False  \n",
       "2                     False  False   False            False  \n",
       "3                     False  False   False            False  \n",
       "4                     False  False   False            False  \n",
       "...                     ...    ...     ...              ...  \n",
       "40944                 False  False   False            False  \n",
       "40945                 False  False   False            False  \n",
       "40946                 False  False   False            False  \n",
       "40947                 False  False   False            False  \n",
       "40948                 False  False   False            False  \n",
       "\n",
       "[40949 rows x 21 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mlxtend.preprocessing import TransactionEncoder # 传入模型的数据需要满足特定的格式，可以用这种方法来转换为bool值，也可以用函数转换为0、1\n",
    "\n",
    "def deal(data):\n",
    "    return data.dropna().tolist()\n",
    "\n",
    "df_arr = df.apply(deal,axis=1).tolist() # 转化成列表\n",
    "te = TransactionEncoder()  # 定义模型\n",
    "df_tf = te.fit_transform(df_arr)\n",
    "df = pd.DataFrame(df_tf,columns=te.columns_)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算频繁模式"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入apriori方法设置最小支持度min_support=0.005求频繁项集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>support</th>\n",
       "      <th>itemsets</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.249994</td>\n",
       "      <td>(B)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.249994</td>\n",
       "      <td>(C)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.249994</td>\n",
       "      <td>(D)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.243327</td>\n",
       "      <td>(Entertainment)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0.158050</td>\n",
       "      <td>(Music)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>0.005983</td>\n",
       "      <td>(S, Sports)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0.005470</td>\n",
       "      <td>(A, Sports)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.005373</td>\n",
       "      <td>(Gaming, A)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>0.005226</td>\n",
       "      <td>(B, Pets &amp; Animals)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>0.005006</td>\n",
       "      <td>(B, Gaming)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>67 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     support             itemsets\n",
       "2   0.249994                  (B)\n",
       "3   0.249994                  (C)\n",
       "5   0.249994                  (D)\n",
       "7   0.243327      (Entertainment)\n",
       "11  0.158050              (Music)\n",
       "..       ...                  ...\n",
       "66  0.005983          (S, Sports)\n",
       "27  0.005470          (A, Sports)\n",
       "22  0.005373          (Gaming, A)\n",
       "37  0.005226  (B, Pets & Animals)\n",
       "32  0.005006          (B, Gaming)\n",
       "\n",
       "[67 rows x 2 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mlxtend.frequent_patterns import apriori\n",
    "frequent_itemsets = apriori(df,min_support=0.005,use_colnames=True)\n",
    "frequent_itemsets.sort_values(by='support',ascending=False,inplace=True)\n",
    "frequent_itemsets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导出关联规则并计算支持度和置信度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入association_rules求得关联规则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>antecedents</th>\n",
       "      <th>consequents</th>\n",
       "      <th>antecedent support</th>\n",
       "      <th>consequent support</th>\n",
       "      <th>support</th>\n",
       "      <th>confidence</th>\n",
       "      <th>lift</th>\n",
       "      <th>leverage</th>\n",
       "      <th>conviction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>(Music)</td>\n",
       "      <td>(S)</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.278276</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.233340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(S)</td>\n",
       "      <td>(Music)</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.400311</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.403978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>(D)</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.495778</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.487452</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>(D)</td>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.120445</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.067888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>(A)</td>\n",
       "      <td>(Gaming)</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.019952</td>\n",
       "      <td>0.005373</td>\n",
       "      <td>0.038334</td>\n",
       "      <td>1.921355</td>\n",
       "      <td>0.002576</td>\n",
       "      <td>1.019115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>(Science &amp; Technology)</td>\n",
       "      <td>(A)</td>\n",
       "      <td>0.058634</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.007277</td>\n",
       "      <td>0.124115</td>\n",
       "      <td>0.885587</td>\n",
       "      <td>-0.000940</td>\n",
       "      <td>0.981693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>(D)</td>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.012284</td>\n",
       "      <td>0.049135</td>\n",
       "      <td>0.858017</td>\n",
       "      <td>-0.002033</td>\n",
       "      <td>0.991449</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>(D)</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.012284</td>\n",
       "      <td>0.214499</td>\n",
       "      <td>0.858017</td>\n",
       "      <td>-0.002033</td>\n",
       "      <td>0.954812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>(Education)</td>\n",
       "      <td>(B)</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.008132</td>\n",
       "      <td>0.201087</td>\n",
       "      <td>0.804367</td>\n",
       "      <td>-0.001978</td>\n",
       "      <td>0.938783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>(B)</td>\n",
       "      <td>(Education)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.008132</td>\n",
       "      <td>0.032529</td>\n",
       "      <td>0.804367</td>\n",
       "      <td>-0.001978</td>\n",
       "      <td>0.991823</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>80 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               antecedents         consequents  antecedent support  \\\n",
       "0                  (Music)                 (S)            0.158050   \n",
       "1                      (S)             (Music)            0.109868   \n",
       "2        (News & Politics)                 (D)            0.060734   \n",
       "3                      (D)   (News & Politics)            0.249994   \n",
       "4                      (A)            (Gaming)            0.140150   \n",
       "..                     ...                 ...                 ...   \n",
       "75  (Science & Technology)                 (A)            0.058634   \n",
       "76                     (D)  (Film & Animation)            0.249994   \n",
       "77      (Film & Animation)                 (D)            0.057266   \n",
       "78             (Education)                 (B)            0.040441   \n",
       "79                     (B)         (Education)            0.249994   \n",
       "\n",
       "    consequent support   support  confidence      lift  leverage  conviction  \n",
       "0             0.109868  0.043982    0.278276  2.532809  0.026617    1.233340  \n",
       "1             0.158050  0.043982    0.400311  2.532809  0.026617    1.403978  \n",
       "2             0.249994  0.030111    0.495778  1.983161  0.014927    1.487452  \n",
       "3             0.060734  0.030111    0.120445  1.983161  0.014927    1.067888  \n",
       "4             0.019952  0.005373    0.038334  1.921355  0.002576    1.019115  \n",
       "..                 ...       ...         ...       ...       ...         ...  \n",
       "75            0.140150  0.007277    0.124115  0.885587 -0.000940    0.981693  \n",
       "76            0.057266  0.012284    0.049135  0.858017 -0.002033    0.991449  \n",
       "77            0.249994  0.012284    0.214499  0.858017 -0.002033    0.954812  \n",
       "78            0.249994  0.008132    0.201087  0.804367 -0.001978    0.938783  \n",
       "79            0.040441  0.008132    0.032529  0.804367 -0.001978    0.991823  \n",
       "\n",
       "[80 rows x 9 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mlxtend.frequent_patterns import association_rules\n",
    "association_rule = association_rules(frequent_itemsets,metric='lift')\n",
    "association_rule = association_rule.sort_values(by='lift',ascending=False).reset_index(drop=True)\n",
    "association_rule"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 规则评价"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "定义规则评价函数，求得Jaccard，cosine，Kulczynski值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "import math\n",
    "def metrics(r,f):\n",
    "    ans = []\n",
    "    for i in range(r.shape[0]):\n",
    "        item = r.iloc[i]\n",
    "        ans.append(f(item))\n",
    "    return ans\n",
    "def Jaccard(item):\n",
    "    return item.support/(item['antecedent support']+item['consequent support']-item.support)\n",
    "def allconf(item):\n",
    "    return item.support/max(item['antecedent support'],item['consequent support'])\n",
    "def cosine(item):\n",
    "    return item.support/math.sqrt(item['antecedent support']*item['consequent support'])\n",
    "def maxconf(item):\n",
    "    return max(item.support/item['antecedent support'],item.support/item['consequent support'])\n",
    "def Kulczynski(item):\n",
    "    return 0.5*(item.support/item['antecedent support']+item.support/item['consequent support'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>antecedents</th>\n",
       "      <th>consequents</th>\n",
       "      <th>antecedent support</th>\n",
       "      <th>consequent support</th>\n",
       "      <th>support</th>\n",
       "      <th>confidence</th>\n",
       "      <th>lift</th>\n",
       "      <th>leverage</th>\n",
       "      <th>conviction</th>\n",
       "      <th>Jaccard</th>\n",
       "      <th>Cosine</th>\n",
       "      <th>Kulczynski</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>(Music)</td>\n",
       "      <td>(S)</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.278276</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.233340</td>\n",
       "      <td>0.196401</td>\n",
       "      <td>0.333762</td>\n",
       "      <td>0.339293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(S)</td>\n",
       "      <td>(Music)</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.400311</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.403978</td>\n",
       "      <td>0.196401</td>\n",
       "      <td>0.333762</td>\n",
       "      <td>0.339293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>(D)</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.495778</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.487452</td>\n",
       "      <td>0.107301</td>\n",
       "      <td>0.244365</td>\n",
       "      <td>0.308112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>(D)</td>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.120445</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.067888</td>\n",
       "      <td>0.107301</td>\n",
       "      <td>0.244365</td>\n",
       "      <td>0.308112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>(A)</td>\n",
       "      <td>(Gaming)</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.019952</td>\n",
       "      <td>0.005373</td>\n",
       "      <td>0.038334</td>\n",
       "      <td>1.921355</td>\n",
       "      <td>0.002576</td>\n",
       "      <td>1.019115</td>\n",
       "      <td>0.034722</td>\n",
       "      <td>0.101600</td>\n",
       "      <td>0.153806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>(Science &amp; Technology)</td>\n",
       "      <td>(A)</td>\n",
       "      <td>0.058634</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.007277</td>\n",
       "      <td>0.124115</td>\n",
       "      <td>0.885587</td>\n",
       "      <td>-0.000940</td>\n",
       "      <td>0.981693</td>\n",
       "      <td>0.038001</td>\n",
       "      <td>0.080279</td>\n",
       "      <td>0.088020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>(D)</td>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.012284</td>\n",
       "      <td>0.049135</td>\n",
       "      <td>0.858017</td>\n",
       "      <td>-0.002033</td>\n",
       "      <td>0.991449</td>\n",
       "      <td>0.041643</td>\n",
       "      <td>0.102662</td>\n",
       "      <td>0.131817</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>(D)</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.012284</td>\n",
       "      <td>0.214499</td>\n",
       "      <td>0.858017</td>\n",
       "      <td>-0.002033</td>\n",
       "      <td>0.954812</td>\n",
       "      <td>0.041643</td>\n",
       "      <td>0.102662</td>\n",
       "      <td>0.131817</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>(Education)</td>\n",
       "      <td>(B)</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.008132</td>\n",
       "      <td>0.201087</td>\n",
       "      <td>0.804367</td>\n",
       "      <td>-0.001978</td>\n",
       "      <td>0.938783</td>\n",
       "      <td>0.028806</td>\n",
       "      <td>0.080877</td>\n",
       "      <td>0.116808</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>(B)</td>\n",
       "      <td>(Education)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.008132</td>\n",
       "      <td>0.032529</td>\n",
       "      <td>0.804367</td>\n",
       "      <td>-0.001978</td>\n",
       "      <td>0.991823</td>\n",
       "      <td>0.028806</td>\n",
       "      <td>0.080877</td>\n",
       "      <td>0.116808</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>80 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               antecedents         consequents  antecedent support  \\\n",
       "0                  (Music)                 (S)            0.158050   \n",
       "1                      (S)             (Music)            0.109868   \n",
       "2        (News & Politics)                 (D)            0.060734   \n",
       "3                      (D)   (News & Politics)            0.249994   \n",
       "4                      (A)            (Gaming)            0.140150   \n",
       "..                     ...                 ...                 ...   \n",
       "75  (Science & Technology)                 (A)            0.058634   \n",
       "76                     (D)  (Film & Animation)            0.249994   \n",
       "77      (Film & Animation)                 (D)            0.057266   \n",
       "78             (Education)                 (B)            0.040441   \n",
       "79                     (B)         (Education)            0.249994   \n",
       "\n",
       "    consequent support   support  confidence      lift  leverage  conviction  \\\n",
       "0             0.109868  0.043982    0.278276  2.532809  0.026617    1.233340   \n",
       "1             0.158050  0.043982    0.400311  2.532809  0.026617    1.403978   \n",
       "2             0.249994  0.030111    0.495778  1.983161  0.014927    1.487452   \n",
       "3             0.060734  0.030111    0.120445  1.983161  0.014927    1.067888   \n",
       "4             0.019952  0.005373    0.038334  1.921355  0.002576    1.019115   \n",
       "..                 ...       ...         ...       ...       ...         ...   \n",
       "75            0.140150  0.007277    0.124115  0.885587 -0.000940    0.981693   \n",
       "76            0.057266  0.012284    0.049135  0.858017 -0.002033    0.991449   \n",
       "77            0.249994  0.012284    0.214499  0.858017 -0.002033    0.954812   \n",
       "78            0.249994  0.008132    0.201087  0.804367 -0.001978    0.938783   \n",
       "79            0.040441  0.008132    0.032529  0.804367 -0.001978    0.991823   \n",
       "\n",
       "     Jaccard    Cosine  Kulczynski  \n",
       "0   0.196401  0.333762    0.339293  \n",
       "1   0.196401  0.333762    0.339293  \n",
       "2   0.107301  0.244365    0.308112  \n",
       "3   0.107301  0.244365    0.308112  \n",
       "4   0.034722  0.101600    0.153806  \n",
       "..       ...       ...         ...  \n",
       "75  0.038001  0.080279    0.088020  \n",
       "76  0.041643  0.102662    0.131817  \n",
       "77  0.041643  0.102662    0.131817  \n",
       "78  0.028806  0.080877    0.116808  \n",
       "79  0.028806  0.080877    0.116808  \n",
       "\n",
       "[80 rows x 12 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "association_rule['Jaccard'] = metrics(association_rule, Jaccard)\n",
    "association_rule['Cosine'] = metrics(association_rule, cosine)\n",
    "association_rule['Kulczynski'] = metrics(association_rule, Kulczynski)\n",
    "association_rule"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 挖掘结果可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "横坐标为support，纵坐标为confidence，透明度为lift值的高低，绘制散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5TcdX3/8eeb3Hazsxs2JCIQQkK4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ov9D/Bv7v6Smf1fogrJgO+7+78fII5lwH+a2fPu/ifV/S+KHJi6j4qMgJldA2Td/fMDjr+ZmC767fWIS2QsVDUkIpJyKhGIiKScSgQiIimnRCAiknJKBCIiKadEICKSckoEIiIp9/8BFSCjapJ49moAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import  matplotlib.pyplot as plt\n",
    "plt.xlabel('support')\n",
    "plt.ylabel('confidence')\n",
    "for i in range(association_rule.shape[0]):\n",
    "    plt.scatter(association_rule.support[i],association_rule.confidence[i],s=20,c='b',alpha=(association_rule.lift.iloc[i])/(association_rule.lift.iloc[0])*0.8/(association_rule.lift.iloc[0]-association_rule.lift.iloc[-1])+0.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "横坐标为support，纵坐标为confidence，透明度为Cosine值的高低，绘制散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deZxcdZnv8c+T9FZd3UlI0hDIQsKiTkQ2G9CLCyAowkhw0BEQHGZyjcugF+aiMCPXlwODSmRGGYGXxoGLIsKIXjSOKIMCOiJLOgJK0AwBshPSZOl0V/VKfvePp4qqdCrp6u46tfT5vl+vflWfU9VVT5rmPOf5rRZCQERE4mtSpQMQEZHKUiIQEYk5JQIRkZhTIhARiTklAhGRmKurdACjNXPmzDB//vxKhyEiUlNWrlz5SgihrdBzNZcI5s+fT0dHR6XDEBGpKWa2bl/P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jGnPgIRkZhTIhARiTklAhGRmFMiEBGJOSUCEZGYUyIQqRJmdpmZNVc6DokfDR8VqQJmll19sj2E8Eql45F4UUUgsWdmSTP7aWbPgmfM7ENmttbMZmaebzezhzPff8HM7jCzB83sOTP7aOb8KWb2azO718yeNbNvmNmkzHMXZNa2f8bMrs/73B4zu8bMHgc+BxwCPGRmD5X7dyDxpkXnROBMYHMI4WwAM5uKL7C3L0cDb8H3mXjSzH6aOX8isBBYB/wc+Asz+23mvd4M7AD+08zODSH8KPPzz4QQPp/53L8BTlVFIOWmikDEl6g+3cyuN7O3hxC6Rnj9j0MIvZkL9kN4AgB4Ivh68q/ii39lV7J8OITQGXzp4DuBd2Re/yq++YxIRakikNgLIfx3Zsnks4Avmdl/AkPkbpSGb1c4vGMt7Of8/taR7gvl2/hEZJ9UEUjsmdkh+Dru3wVuwJceXos354AvpJZvkZk1mdkMfLGvFZnzJ5rZgkzfwIeA3wCPA+80s5mZDuELgF/tI5RuoLU0/yqR4qkiEPF9Xr9iZruBQeATQAK41cz+Ab+Y53sC+CkwD7g2hLDZzF4HPAp8OfN+vwbuDSHsNrO/x5uQDLgvhPDjfcSxDPiZmb0UQji1tP9EkX3T8FGRUTCzLwA9IYQbhp0/BV8u+s8rEZfIeKhpSEQk5lQRiIjEnCoCEZGYUyIQEYk5JQIRkZhTIhARiTklAhGRmPv/ihqH71PtzIkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.xlabel('support')\n",
    "plt.ylabel('confidence')\n",
    "association_rule = association_rule.sort_values(by='Cosine',ascending=False).reset_index(drop=True)\n",
    "for i in range(association_rule.shape[0]):\n",
    "    plt.scatter(association_rule.support[i],association_rule.confidence[i],s=20,c='b',alpha=(association_rule.Cosine.iloc[i])/(association_rule.Cosine.iloc[0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "横坐标为support，纵坐标为confidence，透明度为Jaccard值的高低，绘制散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5hcdZ3n8fc3fau+JSSkRZKAAQSRKAnagOwMIEJY1BnQESRBZdzJDjusjLiMjxN1HlfxmWdmdAZWR0aW2Tg76iwR2GWGGUVuIuiImCDhEkAIMZBOc8m10119qa7u3/7xrWNVOpV0dXeduvT5vJ6nnlPnVHWdbyrd53t+dwshICIiyTWn2gGIiEh1KRGIiCScEoGISMIpEYiIJJwSgYhIwjVWO4CpWrhwYVi6dGm1wxARqSuPPfbYrhBCV7HX6i4RLF26lI0bN1Y7DBGRumJmLx3qNVUNiYgknBKBiEjCKRGIiCScEoGISMLFmgjM7CIz+5WZbTGztUVe/7iZ7TSzTbnHf44zHhEROVhsvYbMrAG4CVgJ9AAbzOyuEMIzE976vRDCNXHFISIihxdnieAMYEsIYWsIIQOsBy6J8XySYOk0bN/uWxGZmjjHESwGthfs9wBnFnnfh8zsHOB54L+FELZPfIOZXQVcBXDsscfGEKrUs8cfhxtvhNFRaGqC666DFSuqHZVI/YizRGBFjk1c/OBfgaUhhFOB+4F/LPZBIYRbQgjdIYTurq6iA+MkodJpTwLt7bBkiW9vuEElA5GpiDMR9ADHFOwvAXoL3xBC2B1CGMnt/j3wzhjjkVlozx4vCXR0+H5Hh+/v2VPduETqSZyJYANwopkdZ2bNwCrgrsI3mNnRBbsXA8/GGI/MQgsWeHXQwIDvDwz4/oIF1Y1LpJ7ElghCCFngGuAe/AJ/Wwhh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Jsw7P3QO4/7JR6iB34M/xOelPB4w11EvvH8MbWTbk/8A/UQ9wTPuOLVDgRzPA7/1DuO38i953/br3Ennvto7n4nwa+Ukdxvxv4+XTPrSkmREQSTm0EIiIJp0QgIpJwSgQiIgmnRCAiknBKBCIiCadEIFIjzOxTZtZW7TgkedR9VKQGmFk0+2R3CGFXteORZFGJQBLPzNrN7Pu5NQueNrPLzWybmS3Mvd5tZj/OPf+imX3HzH5kZi+Y2R/mjr/bzB42szvN7Bkzu9nM5uReW52b2/5pM/urgvMOmNn1ZvYo8HlgEfCgmT1Y6e9Akk2TzonARUBvCOH9AGY2D59g71BOBd6FrzPxuJl9P3f8DOAU4CXgh8DvmdnPcp/1TmAvcK+ZfSCE8M+5n386hPCF3Hn/ADhPJQKpNJUIRHyK6gvM7K/M7OwQQt8k7/+XEMJQ7oL9IJ4AAH4RfD75MXzyr2gmyx+HEHYGnzr4n4Bzcu8fwxefEakqlQgk8UIIz+emTH4f8Bdmdi+QJX+jNHG5wokNa+Ewxw83j/RwqNzCJyKHpBKBJJ6ZLcLncf8u8Nf41MPb8Ooc8InUCl1iZikzOxKf7GtD7vgZZnZcrm3gcuCnwKPAuWa2MNcgvBp46BCh9AOd5flXiZROJQIRX+f1q2Y2DowCVwOtwDoz+xx+MS/0C+D7wLHAl0MIvWZ2EvAI8Je5z3sYuDOEMG5mn8WrkAz4QQjhXw4Rxy3A3Wb2SgjhvPL+E0UOTd1HRabAzL4IDIQQ/nrC8Xfj00X/TjXiEpkJVQ2JiCScSgQiIgmnEoGISMIpEYiIJJwSgYhIwikRiIgknBKBiEjC/X94IXYCw7yyaAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.xlabel('support')\n",
    "plt.ylabel('confidence')\n",
    "association_rule = association_rule.sort_values(by='Jaccard',ascending=False).reset_index(drop=True)\n",
    "for i in range(association_rule.shape[0]):\n",
    "    plt.scatter(association_rule.support[i],association_rule.confidence[i],s=20,c='b',alpha=(association_rule.Jaccard.iloc[i])/(association_rule.Jaccard.iloc[0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 挖掘结果进行分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>antecedents</th>\n",
       "      <th>consequents</th>\n",
       "      <th>antecedent support</th>\n",
       "      <th>consequent support</th>\n",
       "      <th>support</th>\n",
       "      <th>confidence</th>\n",
       "      <th>lift</th>\n",
       "      <th>leverage</th>\n",
       "      <th>conviction</th>\n",
       "      <th>Jaccard</th>\n",
       "      <th>Cosine</th>\n",
       "      <th>Kulczynski</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>(Music)</td>\n",
       "      <td>(S)</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.278276</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.233340</td>\n",
       "      <td>0.196401</td>\n",
       "      <td>0.333762</td>\n",
       "      <td>0.339293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>(S)</td>\n",
       "      <td>(Music)</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.158050</td>\n",
       "      <td>0.043982</td>\n",
       "      <td>0.400311</td>\n",
       "      <td>2.532809</td>\n",
       "      <td>0.026617</td>\n",
       "      <td>1.403978</td>\n",
       "      <td>0.196401</td>\n",
       "      <td>0.333762</td>\n",
       "      <td>0.339293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>(D)</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.495778</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.487452</td>\n",
       "      <td>0.107301</td>\n",
       "      <td>0.244365</td>\n",
       "      <td>0.308112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>(D)</td>\n",
       "      <td>(News &amp; Politics)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.060734</td>\n",
       "      <td>0.030111</td>\n",
       "      <td>0.120445</td>\n",
       "      <td>1.983161</td>\n",
       "      <td>0.014927</td>\n",
       "      <td>1.067888</td>\n",
       "      <td>0.107301</td>\n",
       "      <td>0.244365</td>\n",
       "      <td>0.308112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>(Gaming)</td>\n",
       "      <td>(A)</td>\n",
       "      <td>0.019952</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.005373</td>\n",
       "      <td>0.269278</td>\n",
       "      <td>1.921355</td>\n",
       "      <td>0.002576</td>\n",
       "      <td>1.176713</td>\n",
       "      <td>0.034722</td>\n",
       "      <td>0.101600</td>\n",
       "      <td>0.153806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>(A)</td>\n",
       "      <td>(Gaming)</td>\n",
       "      <td>0.140150</td>\n",
       "      <td>0.019952</td>\n",
       "      <td>0.005373</td>\n",
       "      <td>0.038334</td>\n",
       "      <td>1.921355</td>\n",
       "      <td>0.002576</td>\n",
       "      <td>1.019115</td>\n",
       "      <td>0.034722</td>\n",
       "      <td>0.101600</td>\n",
       "      <td>0.153806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>(C)</td>\n",
       "      <td>(Education)</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.019292</td>\n",
       "      <td>0.077171</td>\n",
       "      <td>1.908259</td>\n",
       "      <td>0.009182</td>\n",
       "      <td>1.039802</td>\n",
       "      <td>0.071152</td>\n",
       "      <td>0.191872</td>\n",
       "      <td>0.277112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>(Education)</td>\n",
       "      <td>(C)</td>\n",
       "      <td>0.040441</td>\n",
       "      <td>0.249994</td>\n",
       "      <td>0.019292</td>\n",
       "      <td>0.477053</td>\n",
       "      <td>1.908259</td>\n",
       "      <td>0.009182</td>\n",
       "      <td>1.434192</td>\n",
       "      <td>0.071152</td>\n",
       "      <td>0.191872</td>\n",
       "      <td>0.277112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>(S)</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.011478</td>\n",
       "      <td>0.200426</td>\n",
       "      <td>1.824241</td>\n",
       "      <td>0.005186</td>\n",
       "      <td>1.113258</td>\n",
       "      <td>0.073737</td>\n",
       "      <td>0.144700</td>\n",
       "      <td>0.152447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>(S)</td>\n",
       "      <td>(Film &amp; Animation)</td>\n",
       "      <td>0.109868</td>\n",
       "      <td>0.057266</td>\n",
       "      <td>0.011478</td>\n",
       "      <td>0.104468</td>\n",
       "      <td>1.824241</td>\n",
       "      <td>0.005186</td>\n",
       "      <td>1.052708</td>\n",
       "      <td>0.073737</td>\n",
       "      <td>0.144700</td>\n",
       "      <td>0.152447</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          antecedents         consequents  antecedent support  \\\n",
       "0             (Music)                 (S)            0.158050   \n",
       "1                 (S)             (Music)            0.109868   \n",
       "2   (News & Politics)                 (D)            0.060734   \n",
       "3                 (D)   (News & Politics)            0.249994   \n",
       "4            (Gaming)                 (A)            0.019952   \n",
       "5                 (A)            (Gaming)            0.140150   \n",
       "6                 (C)         (Education)            0.249994   \n",
       "7         (Education)                 (C)            0.040441   \n",
       "8  (Film & Animation)                 (S)            0.057266   \n",
       "9                 (S)  (Film & Animation)            0.109868   \n",
       "\n",
       "   consequent support   support  confidence      lift  leverage  conviction  \\\n",
       "0            0.109868  0.043982    0.278276  2.532809  0.026617    1.233340   \n",
       "1            0.158050  0.043982    0.400311  2.532809  0.026617    1.403978   \n",
       "2            0.249994  0.030111    0.495778  1.983161  0.014927    1.487452   \n",
       "3            0.060734  0.030111    0.120445  1.983161  0.014927    1.067888   \n",
       "4            0.140150  0.005373    0.269278  1.921355  0.002576    1.176713   \n",
       "5            0.019952  0.005373    0.038334  1.921355  0.002576    1.019115   \n",
       "6            0.040441  0.019292    0.077171  1.908259  0.009182    1.039802   \n",
       "7            0.249994  0.019292    0.477053  1.908259  0.009182    1.434192   \n",
       "8            0.109868  0.011478    0.200426  1.824241  0.005186    1.113258   \n",
       "9            0.057266  0.011478    0.104468  1.824241  0.005186    1.052708   \n",
       "\n",
       "    Jaccard    Cosine  Kulczynski  \n",
       "0  0.196401  0.333762    0.339293  \n",
       "1  0.196401  0.333762    0.339293  \n",
       "2  0.107301  0.244365    0.308112  \n",
       "3  0.107301  0.244365    0.308112  \n",
       "4  0.034722  0.101600    0.153806  \n",
       "5  0.034722  0.101600    0.153806  \n",
       "6  0.071152  0.191872    0.277112  \n",
       "7  0.071152  0.191872    0.277112  \n",
       "8  0.073737  0.144700    0.152447  \n",
       "9  0.073737  0.144700    0.152447  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "association_rule = association_rule.sort_values(by='lift',ascending=False).reset_index(drop=True)\n",
    "association_rule.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "结果表明：\n",
    "- Music类别的youtube视频观看的人更多，为S级，他们之间具有很强的相关性。\n",
    "- News & Politics类别的youtube视频观看的人最少，为D级，他们之间同样具有很强的相关性。\n",
    "- Film & Animation类别的youtube视频观看的人同样更多，为S级\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
